# -*- coding:latin-1 -*-             

################################################################
# Date: 2010-12-03                                             #
# Auteurs: Boris Burgarella, Rodolphe Marion,                  #
# Nicolas Pierres-Charles, Frederic Campo, Maximilien Rigaut   #
# Nom: Neoinvader                                              #
# Version: 0.1a                                                #
# Copyright 2010: Team Cocobug                                 #
################################################################
#    This file is part of Neoinvader   
#                                    
#    Noeinvader is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#                                    
#    Noeinvader is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#                                    
#    You should have received a copy of the GNU General Public License
#    along with Neoinvader.
#    If not, see <http://www.gnu.org/licenses/>.
###############################################################
import sys,os, pygame

###############################################################
# Definitions de fonctions: SYSTEME                           #
###############################################################
def loadsound(name):
    class NoneSound:
        def play(self): pass
    if not pygame.mixer:
        return NoneSound()
    try:
        sound = pygame.mixer.Sound(name)
    except pygame.error, message:
        print 'Cannot load sound:', wav
        raise SystemExit, message
    return sound

def loadimage(name, colorkey=None):
    try:
        image = pygame.image.load(name)
    except pygame.error, message:
        print 'Cannot load image:', name
        raise SystemExit, message
    #image = image.convert()
    if colorkey is not None:
        if colorkey is -1:
            colorkey = image.get_at((0,0))
        image.set_colorkey(colorkey, RLEACCEL)
    return image, image.get_rect()

def save_pref(name):
    pass
        
        